Skip to content

Update StaffDashboard columns to show Name, Role, Location, Phone, Status, Actions#175

Open
ihsankahveci wants to merge 1 commit intokc-pit-2026-testfrom
staff-dashboard-columns-only
Open

Update StaffDashboard columns to show Name, Role, Location, Phone, Status, Actions#175
ihsankahveci wants to merge 1 commit intokc-pit-2026-testfrom
staff-dashboard-columns-only

Conversation

@ihsankahveci
Copy link
Copy Markdown
Collaborator

Summary

  • Updated StaffDashboard table columns to display more relevant staff information
  • Replaced Employee ID column with Name as the first column
  • Added Location and Phone Number columns for better staff management
  • Reordered columns to: Name, Role, Location, Phone, Status, Actions

Changes

  • Modified StaffMember interface to include locationObjectId and phone fields
  • Integrated location service to fetch and map location names
  • Updated table headers and sorting functionality for new columns
  • Updated StaffDashboardRow component to display new fields

Test plan

  • Verify table displays all new columns correctly
  • Test sorting functionality for each column
  • Confirm location names are properly resolved from location service
  • Check that phone numbers display correctly or show N/A when missing

…atus, Actions

- Removed employeeId column
- Renamed Position to Role in UI
- Added Location column showing hub name instead of ObjectId
- Added Phone Number column
- Updated StaffMember interface across all components
- Fetch locations data to resolve locationObjectId to hubName

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@ihsankahveci ihsankahveci requested a review from Copilot January 26, 2026 10:12
@ihsankahveci ihsankahveci changed the base branch from main to kc-pit-2026-test January 26, 2026 10:14
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request updates the StaffDashboard table to display more comprehensive staff information. The changes replace the Employee ID column with a Name column as the first column and add Location and Phone Number columns to provide better context for staff management.

Changes:

  • Modified the StaffMember interface to remove employeeId and add locationObjectId and phone fields
  • Integrated the location service to fetch location data and create a lookup map for resolving location IDs to names
  • Updated table headers, sorting functionality, and column rendering to display Name, Role, Location, Phone, Status, and Actions

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 7 comments.

File Description
client/src/pages/StaffDashboard/utils/StaffDashboardUtils.tsx Updated StaffMember interface and transformUsersToStaff function to include location and phone fields, accepting locationMap parameter for location name resolution
client/src/pages/StaffDashboard/components/StaffDashboardTable.tsx Updated table headers and sorting configuration to replace Employee ID with Name column and add Location and Phone Number columns; updated colSpan to 6 for empty state
client/src/pages/StaffDashboard/components/StaffDashboardRow.tsx Removed Employee ID cell display and added Location and Phone cells; removed unused Typography import
client/src/pages/StaffDashboard/StaffDashboard.tsx Added locationService integration to fetch location data and created locationMap for location name resolution

employeeId: string;
name: string;
position: string;
locationObjectId: string;
Copy link

Copilot AI Jan 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The field name locationObjectId is misleading because it stores the location name (hubName) rather than the ObjectId. According to the codebase convention established in client/src/types/Survey.ts and client/src/hooks/useApi.tsx (line 339), the field that stores the resolved location name should be called locationName, not locationObjectId.

This should be renamed to locationName in the StaffMember interface and all usages for consistency with the rest of the codebase.

Copilot uses AI. Check for mistakes.
employeeId: string;
name: string;
position: string;
locationObjectId: string;
Copy link

Copilot AI Jan 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The field name locationObjectId is misleading because it stores the location name (hubName) rather than the ObjectId. According to the codebase convention established in client/src/types/Survey.ts and client/src/hooks/useApi.tsx (line 339), this should be renamed to locationName for consistency.

Suggested change
locationObjectId: string;
/**
* Human-readable location name (hubName), following app-wide convention.
*/
locationName: string;
/**
* @deprecated This field name is misleading; use `locationName` instead.
* Kept optional for backward compatibility with older code.
*/
locationObjectId?: string;

Copilot uses AI. Check for mistakes.
employeeId: string;
name: string;
position: string;
locationObjectId: string;
Copy link

Copilot AI Jan 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The field name locationObjectId is misleading because it stores the location name (hubName) rather than the ObjectId. According to the codebase convention established in client/src/types/Survey.ts and client/src/hooks/useApi.tsx (line 339), this should be renamed to locationName for consistency.

Suggested change
locationObjectId: string;
locationName: string;

Copilot uses AI. Check for mistakes.
employeeId: string;
name: string;
position: string;
locationObjectId: string;
Copy link

Copilot AI Jan 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The field name locationObjectId is misleading because it stores the location name (hubName) rather than the ObjectId. According to the codebase convention established in client/src/types/Survey.ts and client/src/hooks/useApi.tsx (line 339), this should be renamed to locationName for consistency.

Suggested change
locationObjectId: string;
locationName: string;

Copilot uses AI. Check for mistakes.
Comment on lines +92 to +98
active={sortConfig.key === 'locationObjectId'}
direction={
sortConfig.key === 'position'
sortConfig.key === 'locationObjectId'
? sortConfig.direction
: 'asc'
}
onClick={() => onSort('position')}
onClick={() => onSort('locationObjectId')}
Copy link

Copilot AI Jan 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The sort key should be locationName instead of locationObjectId to match the corrected field name and maintain consistency with the codebase convention (see client/src/types/Survey.ts).

Copilot uses AI. Check for mistakes.
</TableCell>
<TableCell>{member.name}</TableCell>
<TableCell>{member.position}</TableCell>
<TableCell>{member.locationObjectId}</TableCell>
Copy link

Copilot AI Jan 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The field reference should be member.locationName instead of member.locationObjectId to match the corrected field name and maintain consistency with the codebase convention (see client/src/types/Survey.ts).

Copilot uses AI. Check for mistakes.
employeeId: user._id ?? 'N/A',
name: `${user.firstName} ${user.lastName}`,
position: user.role,
locationObjectId: locationMap.get(user.locationObjectId?.toString() ?? '') ?? 'N/A',
Copy link

Copilot AI Jan 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The field name in the object literal should be locationName instead of locationObjectId to match the corrected field name and maintain consistency with the codebase convention (see client/src/types/Survey.ts and client/src/hooks/useApi.tsx line 339).

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants